/**
 * @param {string[]} bank
 * @return {number}
 */
 var numberOfBeams = function(bank) {
  let ans = 0
  const getSum = (s1, s2) => {
    let cnt1 = 0, cnt2 = 0
    for(let i = 0; i<s1.length; i++){
      if(s1[i] === '1') cnt1++
      if(s2[i] === '1') cnt2++
    }
    return cnt1 * cnt2
  }
  for(let i = 0; i<bank.length; i++){
    for(let j = i+1; j<bank.length; j++){
      let now = getSum(bank[i], bank[j])
      if(now){
        ans += now
        break
      }
    }
  }
  return ans
};